﻿using System.Collections.Generic;
using System.Linq;

namespace Extended.NetRouting
{
    [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix", Justification = "Class is also a RouteProvider and I would prefer to have that suffix")]
    public class MemoryRouteProvider : List<IRoute>, IRouteProvider
    {
        /// <summary>
        /// Gets all routes that start from the given node.
        /// </summary>
        public IEnumerable<IRoute> GetRoutesFromNode(object node)
        {
            return this.Where(r => r.Start.Equals(node));
        }
    }
}